app.service('uploadService',function ($http) {

    this.uploadFile = function () {

        var formData = new FormData();
        formData.append("file",file.files[0]);

        return $http({
            url:'../upload.do',
            method:'POST',
            data:formData,
            headers: {'Content-Type':undefined},//anjularjs 对于 post 和 get 请求默认的 Content-Type header 是 application/json
            transformRequest: angular.identity
        });
    }
});